home *** CD-ROM | disk | FTP | other *** search
- Path: svnews.ubinet.ubs.com!ubszh!ian.johnston@ubs.com
- From: gzhjis@ubszh.net.ch (Ian Johnston (by ubsswop))
- Newsgroups: comp.lang.c++
- Subject: Re: Can you overload a constructor?
- Date: 15 Mar 1996 18:00:20 GMT
- Organization: UBS
- Distribution: world
- Message-ID: <4icb7k$2fa@ubszh.fh.zh.ubs.com>
- References: <Do859K.K9B@watserv3.uwaterloo.ca> <31483CDC.4B0C@staff.ichange.com> <4ibqan$br5@si-nic.hrz.uni-siegen.de>
- NNTP-Posting-Host: nol2179.fh.zh.ubs.com
-
- In article <4ibqan$br5@si-nic.hrz.uni-siegen.de>, plrunu@informatik.uni-siegen.de (Runu Knips) writes:
- |> Sorry, it is impossible to OVERLOAD a constructor. A constructor
- |> is ALWAYS called, if there is one for a class. And before it
- |> get called, any constructor for superclasses get called.
- |>
- |> Likewise with the destructor (but the destructor of the super-
- |> classes will be called AFTER the destructor).
- |>
- |> There are no other functions which behave like this, so it can't
- |> be called overloading. You cannot supress the constructor of
- |> a superclass, but you can overload and supress a virtual function
- |> of a superclass.
- |>
-
- You are mixing up overloading and overriding.
-
- Overloading is where several functions have the same name, but different
- argument lists.
-
- Overriding is where a function in a derived class is used in place of
- a function in a base class.
-
-
- Ian
-